package top.kangyaocoding.ltzf.payment.app.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import top.kangyaocoding.ltzf.utils.SignUtils;

import java.util.HashMap;

/**
 * @Author K·Herbert
 * @Description
 * @Date 2024-05-14 20:34
 */
@Data
public class GetRefundOrderRequest {
    /*商户号*/
    @JsonProperty("mch_id")
    private String mchId;
    /*商户退款单号*/
    @JsonProperty("out_refund_no")
    private String outRefundNo;

    private final String timestamp = String.valueOf(System.currentTimeMillis() / 1000);

    /*创建签名*/
    public String createSign(String key) {
        HashMap<String, String> dataMap = new HashMap<>();
        dataMap.put("mch_id", mchId);
        dataMap.put("out_refund_no", outRefundNo);
        dataMap.put("timestamp", timestamp);
        return SignUtils.createSign(dataMap, key);
    }
}
